From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0141.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0138.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0134.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0133.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0133.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0131.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0126.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0126.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0125.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0125.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0125.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0124.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0123.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0118.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0142.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0139.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0135.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0134.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0134.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0132.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0127.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0127.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0126.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0126.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0126.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0125.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0124.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0119.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0143.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0140.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0136.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0135.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0135.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0133.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0128.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0128.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0127.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0127.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0127.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0126.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0125.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0120.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0144.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0141.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0137.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0136.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0136.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0134.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0129.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0129.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0128.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0128.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0128.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0127.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0126.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0121.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0145.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0142.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0138.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0137.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0137.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0135.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0130.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0130.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0129.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0129.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0129.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0128.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0127.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0122.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0146.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0143.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0139.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0138.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0138.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0136.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0131.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0131.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0130.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0130.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0130.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0129.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0128.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0123.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0147.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0144.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0140.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0139.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0139.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0137.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0132.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0132.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0131.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0131.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0131.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0130.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0129.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0124.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0148.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0145.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0141.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0140.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0140.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0138.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0133.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0133.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0132.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0132.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0132.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0131.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0130.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0125.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0149.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0146.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0142.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0141.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0141.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0139.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0134.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0134.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0133.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0133.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0133.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0132.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0131.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0126.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0150.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0147.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0143.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0142.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0142.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0140.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0135.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0135.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0134.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0134.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0134.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0133.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0132.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0127.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0001.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0001.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0001.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0001.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0001.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0001.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0001.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0001.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0001.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0001.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0001.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0001.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0001.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0002.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0002.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0002.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0002.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0002.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0002.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0002.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0002.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0002.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0002.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0002.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0002.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0002.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0003.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0003.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0003.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0003.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0003.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0003.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0003.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0003.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0003.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0003.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0003.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0003.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0003.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0004.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0004.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0004.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0004.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0004.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0004.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0004.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0004.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0004.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0004.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0004.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0004.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0004.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0005.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0005.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0005.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0005.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0005.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0005.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0005.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0005.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0005.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0005.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0005.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0005.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0005.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0006.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0006.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0006.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0006.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0006.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0006.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0006.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0006.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0006.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0006.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0006.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0006.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0006.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0007.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0007.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0007.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0007.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0007.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0007.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0007.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0007.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0007.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0007.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0007.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0007.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0007.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0008.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0008.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0008.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0008.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0008.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0008.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0008.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0008.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0008.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0008.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0008.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0008.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0008.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0009.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0009.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0009.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0009.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0009.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0009.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0009.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0009.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0009.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0009.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0009.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0009.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0009.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0010.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0010.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0010.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0010.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0010.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0010.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0010.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0010.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0010.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0010.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0010.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0010.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0010.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0001.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0001.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0001.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0001.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0001.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0001.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0001.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0001.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0001.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0001.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0001.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0001.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0001.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0002.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0002.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0002.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0002.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0002.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0002.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0002.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0002.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0002.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0002.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0002.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0002.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0002.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0003.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0003.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0003.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0003.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0003.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0003.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0003.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0003.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0003.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0003.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0003.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0003.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0003.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0004.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0004.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0004.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0004.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0004.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0004.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0004.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0004.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0004.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0004.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0004.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0004.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0004.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0005.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0005.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0005.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0005.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0005.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0005.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0005.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0005.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0005.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0005.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0005.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0005.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0005.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0006.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0006.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0006.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0006.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0006.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0006.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0006.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0006.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0006.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0006.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0006.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0006.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0006.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0007.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0007.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0007.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0007.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0007.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0007.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0007.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0007.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0007.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0007.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0007.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0007.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0007.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0008.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0008.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0008.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0008.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0008.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0008.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0008.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0008.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0008.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0008.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0008.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0008.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0008.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0009.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0009.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0009.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0009.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0009.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0009.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0009.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0009.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0009.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0009.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0009.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0009.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0009.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0010.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0010.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0010.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0010.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0010.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0010.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0010.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0010.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0010.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0010.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0010.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0010.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0010.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0001.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0001.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0001.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0001.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0001.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0001.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0001.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0001.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0001.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0001.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0001.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0001.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0001.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0002.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0002.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0002.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0002.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0002.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0002.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0002.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0002.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0002.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0002.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0002.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0002.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0002.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0003.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0003.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0003.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0003.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0003.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0003.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0003.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0003.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0003.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0003.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0003.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0003.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0003.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0004.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0004.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0004.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0004.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0004.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0004.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0004.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0004.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0004.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0004.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0004.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0004.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0004.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0005.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0005.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0005.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0005.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0005.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0005.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0005.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0005.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0005.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0005.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0005.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0005.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0005.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0006.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0006.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0006.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0006.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0006.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0006.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0006.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0006.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0006.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0006.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0006.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0006.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0006.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0007.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0007.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0007.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0007.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0007.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0007.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0007.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0007.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0007.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0007.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0007.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0007.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0007.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0008.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0008.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0008.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0008.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0008.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0008.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0008.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0008.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0008.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0008.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0008.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0008.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0008.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0009.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0009.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0009.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0009.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0009.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0009.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0009.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0009.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0009.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0009.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0009.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0009.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0009.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0010.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0010.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0010.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0010.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0010.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0010.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0010.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0010.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0010.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0010.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0010.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0010.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0010.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0011.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0011.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0011.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0011.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0011.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0011.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0011.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0011.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0011.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0011.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0011.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0011.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0011.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0011.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0012.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0012.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0012.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0012.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0012.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0012.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0012.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0012.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0012.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0012.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0012.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0012.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0012.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0012.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0013.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0013.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0013.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0013.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0013.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0013.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0013.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0013.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0013.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0013.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0013.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0013.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0013.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0013.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0014.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0014.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0014.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0014.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0014.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; > > private static final byte ESC = 0x1B; > > > > // Constants for parity. > > public static final int PARITY_NONE = 0; > > public static final int PARITY_ODD = 1; > > public static final int PARITY_EVEN = 2; > > public static final int PARITY_MARK = 3; > > public static final int PARITY_SPACE = 4; > > > > private SerialPort sp; > > private InputStream in; > > private OutputStream out; > > private boolean bcc; // Flag indicating whether or not Block > > Check Character is appended to messages. > > > > private MagCardListener notifiable; > > > > public EmbeddedMagtekMt85(String serialPort) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { this(serialPort, > > "MagtekMt85", 32000); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout) throws PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > > } > > > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > > timeout, int bitsPerSecond, int parity, boolean bcc) throws > > PortInUseException, NoSuchPortException, > > UnsupportedCommOperationException, IOException { > > CommPortIdentifier cpi = > > CommPortIdentifier.getPortIdentifier(serialPort); > > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > > if (timeout <= MT85_ENCODE_TIMEOUT) { > > throw new UnsupportedCommOperationException("Timeout must be > > greater than MT-85 encode timeout (30s)."); > > } > > sp.enableReceiveTimeout(timeout); > > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > > > switch (parity) { > > case PARITY_NONE: > > parity = SerialPort.PARITY_NONE; > > break; > > case PARITY_ODD: > > parity = SerialPort.PARITY_ODD; > > break; > > case PARITY_EVEN: > > parity = SerialPort.PARITY_EVEN; > > break; > > case PARITY_MARK: > > parity = SerialPort.PARITY_MARK; > > break; > > case PARITY_SPACE: > > parity = SerialPort.PARITY_SPACE; > > break; > > default: > > throw new UnsupportedCommOperationException("Invalid > > parity parameter."); > > } > > > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > > SerialPort.STOPBITS_1, parity); > > > > in = sp.getInputStream(); > > out = sp.getOutputStream(); > > > > this.bcc = bcc; > > } > > > > .................. > > } > > Hi Henty > > What do you mean by fail? For more debugging you can recompile the jar > after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. > Further debugging is available in the native code but not recommended. You > would have to recompile the dll which isn't a great experience to say the > least. > > The settings look sane. RxTx and Sun CommAPI do have slightly different > behavior and defaults as the defaults are not documented and both efforts > have different organic origins. Usually, RxTx just drops in without issue > though. > > The w32 serial port support is not bug free but is used in production > software without significant problems. > (I'm using a USB->serial convert (PL2303X) for the debug info below, but I've seen the same behaviour with a normal serial port.) There are no exception thrown so, from the startup point of view, everything seems OK. However, there are 2 symptoms: a) magcard reader has a LED to show when serial comms is established. Red=off, Green=on. It stays red with rxtx. It goes green with javax.comm and hyperterminal. On occasion I've seen the LED briefly flash green once or twice when rxtx tries to connect, but this happens very rarely (it did not occur in the test case below) b) swiping a magcard through the reader results in nothing (no debug info from rxtx) I've included debug code below (turned the flags you mentioned to true). Note - if I pull out the usb cable an exception is thrown at startup because com6 dissapears. So COM6 is definitely there and being seen. - if I disconnect the magcard reader from the usb->serial converter, no exception is thrown - a 9pin->25pin converter is used. ------------------------------- Debug info (I've snipped some of the repetitive stuff): RXTXCommDriver {} 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 RXTXCommDriver:initialize() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 1 checking registry for ports of type 1 scanning device directory //./ for ports of type 1 scanning for serial ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: COM COM1 COM 1 1 COM2 COM 2 2 COM3 COM 3 3 COM4 COM 4 4 COM5 COM 5 5 COM6 COM 6 6 [......snip] COM253 COM 253 253 COM254 COM 254 254 COM255 COM 255 255 COM256 COM 256 256 Leaving registerValidPorts() The file: gnu.io.rxtx.properties doesn't exists. java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_09\lib\ext\gnu.io.rxtx.properties (The system cannot find the file specified) checking for system-known ports of type 2 checking registry for ports of type 2 scanning device directory //./ for ports of type 2 scanning for parallel ports for os Windows XP Entering registerValidPorts() Candidate devices: COM1 COM2 COM3 COM4 COM5 COM6 [......snip] COM253 COM254 COM255 COM256 LPT1 LPT2 LPT3 valid port prefixes: LPT LPT1 LPT 1 1 LPT2 LPT 2 2 LPT3 LPT 3 3 Leaving registerValidPorts() RXTXCommDriver:getCommPort(COM6,1) > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From doug at dupreeinc.com Wed Jan 17 15:48:38 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Wed, 17 Jan 2007 14:48:38 -0800 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: <45AEA7C6.10404@dupreeinc.com> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the enumeration code. Unfortunately, it looks like the only information I can detect is the presence of the COM port. I was hoping to get some type of description of the hardware so I could ferret out my device from the available ports. Doug Trent Jarvi wrote: >On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > > > >>Hello, >> >>I have a hardware device that uses an FTDI USB module with their virtual >>com port (VCP) driver. My java application uses RXTX to communicate >>with this device and everything seems to be working pretty well. I need >>to find the virtual com port that this device uses from within my java >>application. Is there any way to use RXTX to interrogate winXP to get >>driver information on com ports so I can pick the correct one >>automatically? Does anybody have any alternate ideas on how to identify >>the com port hardware from within java? >> >> >> > >Hi Doug > >RxTx enumerates the ports that are on the system by opening and trying a >timed out read. There is no support for hotplug detection. There are >examples of enumerating the ports in the contrib directory with the source >code. > >-- >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/20070117/f30a802b/attachment-0014.html From tjarvi at qbang.org Wed Jan 17 18:21:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 17 Jan 2007 18:21:50 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AEA7C6.10404@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: Hi Doug I have only really been looking at w32 APIs that have been in msft products since win ~3.0 when the real work was done. It is probably possible to get more information through the registry or other means today. We do not have that code in place but it would be interesting to see. On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw the > enumeration code. Unfortunately, it looks like the only information I can > detect is the presence of the COM port. I was hoping to get some type of > description of the hardware so I could ferret out my device from the > available ports. > > Doug > > Trent Jarvi wrote: > >> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >> >> >>> Hello, >>> >>> I have a hardware device that uses an FTDI USB module with their virtual >>> com port (VCP) driver. My java application uses RXTX to communicate >>> with this device and everything seems to be working pretty well. I need >>> to find the virtual com port that this device uses from within my java >>> application. Is there any way to use RXTX to interrogate winXP to get >>> driver information on com ports so I can pick the correct one >>> automatically? Does anybody have any alternate ideas on how to identify >>> the com port hardware from within java? >>> >>> >> >> Hi Doug >> >> RxTx enumerates the ports that are on the system by opening and trying a >> timed out read. There is no support for hotplug detection. There are >> examples of enumerating the ports in the contrib directory with the source >> code. >> >> -- >> 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 Thu Jan 18 02:50:51 2007 From: joachim at buechse.de (Joachim Buechse) Date: Thu, 18 Jan 2007 10:50:51 +0100 Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: References: <45AD4C8D.8080106@dupreeinc.com> <45AEA7C6.10404@dupreeinc.com> Message-ID: It's probably possible to get more information, but I doubt that it's possible using the VCP drivers. I''m also writing software for a device based on an FTDI chip - I've seen others around here as well. It seems to me, as if FTDI has a good portion of the custom device market. It may be worth considerung to support their direct drivers (D2XX) in RXTX or javax.comm 2007 directly... possibly via a plugin.. then again many custom device producers don't care to feed specific data into the USB bridge chip (the FTDI sales model kind of discourages this). If it is your own device (ie you control the firmware) you may want to try and teach it some AT (hayes) commands. ie AT ATI ATI3 etc. This would allow you to "poll" the ports in a modem compatible manner. It's not guarenteed that all devices will react happily to AT but in my experience almost all do. If I'm searching a device I start polling ports with a simple AT - if there is no "OK" response I let the device alone. If I get an OK I request ATI and possibly ATI3 where I3 usually provides a human readable information string. (BTW that's the same way Windows finds the correct modem driver). I don't think RXTX or javax.comm should do this kind of interrogation behind the scenes, but maybe we should consider including "pollPortsForDeviceInformation" or/and "autopollPortsForDeviceInformation" methods in future versions or in an add on. Regards, Joachim --- Joachim B?chse Software solutions and Consulting Hadlaubsteig 2 CH-8006 Z?rich On 18.01.2007, at 02:21, Trent Jarvi wrote: > > Hi Doug > > I have only really been looking at w32 APIs that have been in msft > products since win ~3.0 when the real work was done. It is probably > possible to get more information through the registry or other means > today. We do not have that code in place but it would be > interesting to > see. > > On Wed, 17 Jan 2007, Doug Thistlethwaite wrote: > >> Thanks for suggestion Trent. I looked at SimpleSnuV1.java and saw >> the >> enumeration code. Unfortunately, it looks like the only >> information I can >> detect is the presence of the COM port. I was hoping to get some >> type of >> description of the hardware so I could ferret out my device from the >> available ports. >> >> Doug >> >> Trent Jarvi wrote: >> >>> On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: >>> >>> >>>> Hello, >>>> >>>> I have a hardware device that uses an FTDI USB module with their >>>> virtual >>>> com port (VCP) driver. My java application uses RXTX to >>>> communicate >>>> with this device and everything seems to be working pretty >>>> well. I need >>>> to find the virtual com port that this device uses from within >>>> my java >>>> application. Is there any way to use RXTX to interrogate winXP >>>> to get >>>> driver information on com ports so I can pick the correct one >>>> automatically? Does anybody have any alternate ideas on how to >>>> identify >>>> the com port hardware from within java? >>>> >>>> >>> >>> Hi Doug >>> >>> RxTx enumerates the ports that are on the system by opening and >>> trying a >>> timed out read. There is no support for hotplug detection. There >>> are >>> examples of enumerating the ports in the contrib directory with >>> the source >>> code. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> _______________________________________________ >>> 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 mklein at vxappliance.com Fri Jan 19 22:27:51 2007 From: mklein at vxappliance.com (Mike Klein) Date: Fri, 19 Jan 2007 21:27:51 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: References: <45AC106B.2060700@vxappliance.com> Message-ID: <45B1A857.8040008@vxappliance.com> See my comments below. Trent Jarvi wrote: >> Faqs reference "you must be in uucp and lock groups"....I have neither >> of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* >> is rw by all. >> >> > > Hi Mike > > ... > Going the Sun CommAPI route is a bad choice for several reasons. RXTX > fully supports Sun's Java efforts but their CommAPI ran into a corner > [Sun's doing] that only a JSR will fix. We [the rxtx community] even > express interest in helping there. If things go well, which I now expect, > we'll have a 'kicker to boot.' But thats not interesting because you > have no serial love today :). I hear ya. > > As for the above error, you may well have found something I'm not aware > of. You can configure with --disable-lockfiles. But really, I'm > interested in seeing who owns the /var/lock dir on your system though. > > ls -ld /var/lock > > mklein at screamer:/opt/jasm$ ls -ld /var/lock drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > This is something of a developer issue you ran into. Since the last > release, the Mac OS X rxtx developers ran into a clubie hint from Apple. > Apple revealed a way to do what locking does without lockfiles. More to > come, but I'm looking at it with production systems in mind and will share > the results. > > ... > -- > Trent Jarvi > tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > Do you know a means of dumping SOs so I can find exported entry points. Then I can figure out lib mismatch/linker issues. I honestly tried every howto and still had no luck. Always ended up with linker error or lock issue. From tjarvi at qbang.org Sun Jan 21 07:13:06 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 21 Jan 2007 07:13:06 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45B1A857.8040008@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45B1A857.8040008@vxappliance.com> Message-ID: >> ls -ld /var/lock >> >> > mklein at screamer:/opt/jasm$ ls -ld /var/lock > drwxrwxrwt 2 root root 40 2007-01-19 19:52 /var/lock > >> This is something of a developer issue you ran into. Since the last >> release, the Mac OS X rxtx developers ran into a clubie hint from Apple. >> Apple revealed a way to do what locking does without lockfiles. More to >> come, but I'm looking at it with production systems in mind and will share >> the results. >> > > Do you know a means of dumping SOs so I can find exported entry points. > Then I can figure out lib mismatch/linker issues. I honestly tried every > howto and still had no luck. Always ended up with linker error or lock > issue. > nm and ldd should be able to do what you want. Is the issue here that you are using debian packages on ubuntu? The only two distros I know of that package rxtx at the moment are debian and gentoo. The packages may be dated on debian but gentoo has been fairly timely. For the lock issue, you need to be able to create a file in /var/lock. It looks like you should be able to. touch /var/lock/LCK.test && rm -f /var/lock/LCK.test You may also check the read/write permissions of /dev/ttyS* -- Trent Jarvi tjarvi at qbang.org From alesinskyy at googlemail.com Mon Jan 22 04:09:07 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 12:09:07 +0100 Subject: [Rxtx] COM-port events processing under Tomcat Message-ID: Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From alesinskyy at googlemail.com Mon Jan 22 07:07:28 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Mon, 22 Jan 2007 15:07:28 +0100 Subject: [Rxtx] Fwd: COM-port events processing under Tomcat In-Reply-To: References: Message-ID: Please, disregard my previous mail - it was application configuration problem, nothing to do with RXTX or Tomcat as such. Regards, Oleksandr ---------- Forwarded message ---------- From: Oleksandr Alesinskyy Date: Jan 22, 2007 12:09 PM Subject: COM-port events processing under Tomcat To: rxtx at qbang.org Hello, I have following code that should listen to CTS changes and make some actions. ------------------------------------------------------------------------------------------------------ public SerialEmulator(String port, RequestService requestService) { checkForNullArgument(port,"port"); fRequestService = requestService; try { synchronized (this.getClass()) { if (fCommPortId==null) fCommPortId= CommPortIdentifier.getPortIdentifier(port); Runtime.getRuntime().addShutdownHook(new Thread("SerialEmulShutdownHook") { @Override public void run() { try { if (fSerialPort!=null) fSerialPort.close(); } catch (Exception e) {} } }); fSerialPort= (SerialPort)fCommPortId.open("FreeCallEmul",2000); fSerialPort.notifyOnCTS(true); fSerialPort.addEventListener(this); fLog.info(String.format("Port %1$s opened",fSerialPort.getName())); } } catch (Exception e) { fLog.error("Can not open port "+port,e); } } /* (non-Javadoc) * @see gnu.io.SerialPortEventListener#serialEvent(gnu.io.SerialPortEvent) */ public void serialEvent(SerialPortEvent ev) { fLog.info("Some event "+ev); if (ev.getEventType()==SerialPortEvent.CTS) { String ip= fExternalId.get(rnd.nextInt(fExternalId.size())); fLog.info("Request from "+ip+" is on "+fSerialPort.isCTS()); if (fSerialPort.isCTS() && fRequestService!=null) { fRequestService.registerRequest(ip); }; } -------------------------------------------------------------------------------------------- when it is run is standalone Java program all works fine. Ift the same object is created in a Java application that runs in Tomcat, port is successfuly opened but CTS events are not recognized (serialEvent methond is never called). Any ideas? Regards, Oleksandr From amarandon at e-xact.com Mon Jan 22 11:59:35 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 10:59:35 -0800 Subject: [Rxtx] Including modified version in a commercial product Message-ID: <45B50997.4020001@e-xact.com> Hi, I need to make a tiny modification on RxTx to make it fit with the needs of a commercial project I'm working on. I'm not an expert in licenses. What I understand so far about the LGPL is that I can include it in a closed-source commercial product but I must redistribute any modification I make to RxTx itself. In my situation, I don't know if it's worth doing it because my modifcation is just calling System.load() instead of System.loadLibrary() to load the native library. Is my interpretation of the license correct? Should I send my patch to the developer? Thanks, Alex From tjarvi at qbang.org Mon Jan 22 16:36:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 22 Jan 2007 16:36:43 -0700 (MST) Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: <45B50997.4020001@e-xact.com> References: <45B50997.4020001@e-xact.com> Message-ID: On Mon, 22 Jan 2007, Alex Marandon wrote: > Hi, > > I need to make a tiny modification on RxTx to make it fit with the needs > of a commercial project I'm working on. I'm not an expert in licenses. > What I understand so far about the LGPL is that I can include it in a > closed-source commercial product but I must redistribute any > modification I make to RxTx itself. In my situation, I don't know if > it's worth doing it because my modifcation is just calling System.load() > instead of System.loadLibrary() to load the native library. > > Is my interpretation of the license correct? Should I send my patch to > the developer? > Hi Alex, We can't give legal advice. Lawyers do that. It does make sense to send a unified diff to the developer so they could recreate or even modify the rxtx binary you provide if need be. -- Trent Jarvi tjarvi at qbang.org From amarandon at e-xact.com Mon Jan 22 17:02:07 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 22 Jan 2007 16:02:07 -0800 Subject: [Rxtx] Including modified version in a commercial product In-Reply-To: References: <45B50997.4020001@e-xact.com> Message-ID: <45B5507F.6070400@e-xact.com> Trent Jarvi wrote: > It does make sense to send a unified diff to the developer so they could > recreate or even modify the rxtx binary you provide if need be. > OK, the patch which I use is attached to this mail. Thanks, Alex -------------- next part -------------- A non-text attachment was scrubbed... Name: rxtx.patch Type: text/x-patch Size: 4283 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070122/d33bc96e/rxtx-0014.bin From joana22 at tid.es Tue Jan 23 04:56:20 2007 From: joana22 at tid.es (Joana Estafanell) Date: Tue, 23 Jan 2007 12:56:20 +0100 Subject: [Rxtx] RxTx and rfcomm Message-ID: <45B5F7E4.1020808@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/b478b92b/attachment-0014.html From alesinskyy at googlemail.com Tue Jan 23 05:05:18 2007 From: alesinskyy at googlemail.com (Oleksandr Alesinskyy) Date: Tue, 23 Jan 2007 13:05:18 +0100 Subject: [Rxtx] Swallowing of runtime exceptions in the gnu.io.SerialPortEventListener#serialEvent Message-ID: Hello, if runtime exception occurs ibt the code of the serial event handler, this exception is silently swallowed by RXTX. Have not tested for all possible runtime exceptions, but it is for sure true for FormatConversionException. Seems to be a bug. Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Regards, Oleksandr Alesinskyy From hellion102 at hotmail.com Tue Jan 23 08:38:43 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Tue, 23 Jan 2007 10:38:43 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070123/cea522ac/attachment-0014.html From mklein at vxappliance.com Tue Jan 23 11:13:28 2007 From: mklein at vxappliance.com (Mike Klein) Date: Tue, 23 Jan 2007 10:13:28 -0800 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B5F7E4.1020808@tid.es> References: <45B5F7E4.1020808@tid.es> Message-ID: <45B65048.20606@vxappliance.com> Joana...could you please tell me filenames and sizes and locations you have for your Ubuntu rxtx install? For following files: SOs, javax.comm.properties, and comm.jar? Did you use solaris/sparc javacomm or generic or linux? I tried several faqs and couldn't get past linking errors or /var/lock issue. If you could "ls -ld /var/lock" I would appreciate it too! thanks, mike klein Joana Estafanell wrote: > Hi all, > > I'm writing a program that writes to and reads from the serial port > under Linux (Ubuntu dapper). In fact, I have bound a nokia mobile > phone to the pc through an rfcomm link (:~$ rfcomm bind 0 @mac) with > which I want to communicate using AT Commands. > > When I try to get the CommPortIdentifier looking through the list > obtained calling the getPortIdentifiers() method, the system opens the > bound port without any problem (the mobile phone asks for a connection > confirmation and disconnects). Once I have the port identifier I have > to open it and set the parameters in order to get the input and output > streams (the mobile phone asks for a second confirmation and remains > connected). > > Is it normal to have two confirmations using a bluetooth link for the > connection? Have anyone been in the same situation and got a solution? > > Any idea or suggestion will be very welcome! > > Thanks, > > Joana. > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070123/e079daa9/attachment-0014.html From joana22 at tid.es Wed Jan 24 04:48:38 2007 From: joana22 at tid.es (Joana Estafanell) Date: Wed, 24 Jan 2007 12:48:38 +0100 Subject: [Rxtx] RxTx and rfcomm In-Reply-To: <45B65048.20606@vxappliance.com> References: <45B5F7E4.1020808@tid.es> <45B65048.20606@vxappliance.com> Message-ID: <45B74796.8090408@tid.es> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/90fdf8ec/attachment-0014.html From lyon at docjava.com Wed Jan 24 05:05:35 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Wed, 24 Jan 2007 07:05:35 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: References: Message-ID: >.... > >Since I am using the rxtx?api in a jar file and >applet, I would like to include the dll in the >jar file with the applet and the rxtx api. >Because of this, the dll will not be >automatically in the PATH or in the bin >directory of the jre. > >I am not sure which route to go with this, but I >was hoping that I would not require to >pre-install the dlls on the machine running the >applet since they are bundled already within the >applet's jar file. Unsigned applets (deployed via any reasonable browsers' JVM) cannot load DLL's as this would be a security violation. The DLL's should be placed in a jar file that is signed by the same certificate as the applet. I have only tried this with Java webstart applications, but I think it might work, in theory ;) As an alternative, you could beam the dll over into the libraries search path. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.html Has some nice ideas. - DL From hellion102 at hotmail.com Wed Jan 24 09:36:04 2007 From: hellion102 at hotmail.com (Rob Fisher) Date: Wed, 24 Jan 2007 11:36:04 -0500 Subject: [Rxtx] Can the rxtxSerial.dll and rxtx.Parallel dlls be in a different folder? In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070124/1dd7c9da/attachment-0014.html From mail.to.falko at gmx.de Fri Jan 26 04:08:47 2007 From: mail.to.falko at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 12:08:47 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9E13F.8000903@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From jason.price at novatech.co.uk Fri Jan 26 06:40:38 2007 From: jason.price at novatech.co.uk (Jason Price) Date: Fri, 26 Jan 2007 13:40:38 -0000 Subject: [Rxtx] Receiving data via modem on windows xp Message-ID: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Hi I am trying to receive data from a modem using rxtx on windows xp. Everything is working fine apart from every now and again the data is split into 2 or more parts. For example when the modem normally responds with CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is that the data I am waiting for is variable in length and ending chars otherwise I would buffer until I got a certain length or char. Is this behaviour rxtx, the serial port or the modem itself? Here is the code I am using to retrieve the data: case SerialPortEvent.DATA_AVAILABLE: try { StringBuffer data = new StringBuffer(); int avail = is.available(); while (is.available() > 0) { byte[] readBuffer = new byte[avail]; is.read(readBuffer); data.append(new String(readBuffer)); avail = is.available(); } processResponse(data.toString().trim()); } catch (IOException e) { handleError(e); } break; any pointers would be greatly appreciated. Regards Jason Price -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070126/b65b3e1b/attachment-0014.html From tjarvi at qbang.org Sat Jan 27 17:34:37 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:34:37 -0700 (MST) Subject: [Rxtx] Problems with serial port communication (baud rate) In-Reply-To: <45B9E13F.8000903@gmx.de> References: <45B9E13F.8000903@gmx.de> Message-ID: On Fri, 26 Jan 2007, Falko Guderian wrote: > Dear all, > > I try to connect via Serial Port (USB) to communicate with a ZigBee > modul (on WinXP). I managed it with a terminal programm (HTerm). > Therefor I have to set up the following parameters: > 100000 baud rate, > 8 data bits, > 1 stop bit, > parity none and > flow control active. > The COM-Port is COM6 and it works. > > But it fails with Java RXTX (and javax.comm). I get no response from the > modul with 100000 baud. With 115200 baud I receive negative response. > Doesn't it work because the baud rate is not supported? I get such an > Exception with javax.com but not with RXTX. Which parameters enable flow > control? Maybee the following code is not right? > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > Is it important to set both IN and OUT? I'm not familiar with the > theory. Maybe it helps if you take a look at the test code. > > ***************************** CODE ************************************ > import gnu.io.CommPort; > import gnu.io.CommPortIdentifier; > import gnu.io.SerialPort; > > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > > public class TwoWaySerialComm > { > public TwoWaySerialComm() > { > super(); > } > > void connect ( String portName ) throws Exception > { > CommPortIdentifier portIdentifier = > CommPortIdentifier.getPortIdentifier(portName); > if ( portIdentifier.isCurrentlyOwned() ) > { > System.out.println("Error: Port is currently in use"); > } > else > { > CommPort commPort = > portIdentifier.open(this.getClass().getName(),2000); > > if ( commPort instanceof SerialPort ) > { > SerialPort serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams( > 100000, > SerialPort.DATABITS_8, > SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); > > serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); > InputStream in = serialPort.getInputStream(); > OutputStream out = serialPort.getOutputStream(); > > (new Thread(new SerialReader(in))).start(); > (new Thread(new SerialWriter(out))).start(); > > } > else > { > System.out.println("Error: Only serial ports are handled > by this example."); > } > } > } > > public static class SerialReader implements Runnable > { > InputStream in; > > public SerialReader ( InputStream in ) > { > this.in = in; > } > > public void run () > { > byte[] buffer = new byte[1024]; > int len = -1; > try > { > while ( ( len = this.in.read(buffer)) > -1 ) > { > System.out.print(new String(buffer,0,len)); > } > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > /** */ > public static class SerialWriter implements Runnable > { > OutputStream out; > > public SerialWriter ( OutputStream out ) > { > this.out = out; > } > > public void run () > { > byte[] bb; > try > { > // set network adress > bb = new byte[]{0x03,0x45,0x01}; > this.out.write(bb); > try { > Thread.sleep(2000); > } catch (InterruptedException e) { > e.printStackTrace(); > } > // enable conncection > bb = new byte[]{0x00,0x01,0x02}; > this.out.write(bb); > } > catch ( IOException e ) > { > e.printStackTrace(); > } > } > } > > public static void main ( String[] args ) > { > try > { > (new TwoWaySerialComm()).connect("COM6"); > } > catch ( Exception e ) > { > e.printStackTrace(); > } > } > } Hi Falko This should work with the custom baudrate patch. There is a binary you can try here: ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-8-testing/ I've not tried that exact baudrate but expect it will work and did not work in the current stable release. The patch is there also. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sat Jan 27 17:50:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 27 Jan 2007 17:50:33 -0700 (MST) Subject: [Rxtx] Receiving data via modem on windows xp In-Reply-To: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> References: <01781BBBF0456F4AB2963F3AF74B914503BD571F@ethel2.novatech.co.uk> Message-ID: On Fri, 26 Jan 2007, Jason Price wrote: > Hi > > I am trying to receive data from a modem using rxtx on windows xp. > Everything is working fine apart from every now and again the data is split > into 2 or more parts. For example when the modem normally responds with > CONNECT 115200 I sometimes get CONNEC then T 115200. The problem I have is > that the data I am waiting for is variable in length and ending chars > otherwise I would buffer until I got a certain length or char. Is this > behaviour rxtx, the serial port or the modem itself? > > Here is the code I am using to retrieve the data: > > > case SerialPortEvent.DATA_AVAILABLE: > try { > StringBuffer data = new StringBuffer(); > int avail = is.available(); > while (is.available() > 0) { > byte[] readBuffer = new byte[avail]; > is.read(readBuffer); > data.append(new String(readBuffer)); > avail = is.available(); > } > > processResponse(data.toString().trim()); > > } catch (IOException e) { > handleError(e); > } > break; > > The events trigger when any data is available. You are getting ahead of the communication at times. One thing you could do is sleep for a moment before checking how many bytes are available so the serial port has the info you are after. -- Trent Jarvi tjarvi at qbang.org From falko.guderian at gmx.de Fri Jan 26 03:41:21 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Fri, 26 Jan 2007 11:41:21 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45B9DAD1.2000205@gmx.de> Dear all, I try to connect via Serial Port (USB) to communicate with a ZigBee modul (on WinXP). I managed it with a terminal programm (HTerm). Therefor I have to set up the following parameters: 100000 baud rate, 8 data bits, 1 stop bit, parity none and flow control active. The COM-Port is COM6 and it works. But it fails with Java RXTX (and javax.comm). I get no response from the modul with 100000 baud. With 115200 baud I receive negative response. Doesn't it work because the baud rate is not supported? I get such an Exception with javax.com but not with RXTX. Which parameters enable flow control? Maybee the following code is not right? serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); Is it important to set both IN and OUT? I'm not familiar with the theory. Maybe it helps if you take a look at the test code. ***************************** CODE ************************************ import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class TwoWaySerialComm { public TwoWaySerialComm() { super(); } void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams( 100000, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_OUT); InputStream in = serialPort.getInputStream(); OutputStream out = serialPort.getOutputStream(); (new Thread(new SerialReader(in))).start(); (new Thread(new SerialWriter(out))).start(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } public static class SerialReader implements Runnable { InputStream in; public SerialReader ( InputStream in ) { this.in = in; } public void run () { byte[] buffer = new byte[1024]; int len = -1; try { while ( ( len = this.in.read(buffer)) > -1 ) { System.out.print(new String(buffer,0,len)); } } catch ( IOException e ) { e.printStackTrace(); } } } /** */ public static class SerialWriter implements Runnable { OutputStream out; public SerialWriter ( OutputStream out ) { this.out = out; } public void run () { byte[] bb; try { // set network adress bb = new byte[]{0x03,0x45,0x01}; this.out.write(bb); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } // enable conncection bb = new byte[]{0x00,0x01,0x02}; this.out.write(bb); } catch ( IOException e ) { e.printStackTrace(); } } } public static void main ( String[] args ) { try { (new TwoWaySerialComm()).connect("COM6"); } catch ( Exception e ) { e.printStackTrace(); } } } ***************************** CODE ************************************ Thank you. Falko From vesaas at hotmail.com Mon Jan 29 03:20:33 2007 From: vesaas at hotmail.com (Tarjei Rommetveit) Date: Mon, 29 Jan 2007 10:20:33 +0000 Subject: [Rxtx] An unexpected error has been detected by Java Runtime Environment Message-ID: Hi, I'm developing a console program for windows xp which communicates through RS232. The console fetches sensor data, processes and displays the data. The serial communication seem to work fine, but, appearently at random time instances, this error occurs. The error may occur after several days with communication, and after recording of 20000-40000 measurements. I have monitored the memory with jconsole, and at the instance when the failure occures, it should be plenty of memory left in all spaces. I am using RXTX 2.1-7r2 without modifying anything. It would be great if anyone could shed some light on this issue. When this error occurs, the console shuts down. Is it possible to avoid that even if the error occurs? The error (from hs_err_pid696.txt): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100034fb, pid=696, tid=2436 # # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) # Problematic frame: # C [rxtxSerial.dll+0x34fb] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --------------- T H R E A D --------------- Current thread (0x02b43400): JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] siginfo: ExceptionCode=0xc0000005, reading address 0x20726f78 Registers: EAX=0x20726f20, EBX=0x26c6e010, ECX=0x00000011, EDX=0x20726f20 ESP=0x0320ef80, EBP=0x0320f0b8, ESI=0x26c6e008, EDI=0x02b43400 EIP=0x100034fb, EFLAGS=0x00010202 Top of Stack: (sp=0x0320ef80) 0x0320ef80: 0000eddd 6d80d24c 0320efc8 00a463ab 0x0320ef90: 000186a0 0000c350 0000c37a 0320efe8 0x0320efa0: 22fff4e0 000000c8 22ffb400 0000004b 0x0320efb0: 22fff4e0 000000c8 0320eff8 6d815a32 0x0320efc0: 00000003 26c6a768 0000008a 0320f05c 0x0320efd0: 6d85271a 26c6a768 0000008a 26c6c128 0x0320efe0: 000000cb 26c6a768 6d86af34 02e11040 0x0320eff0: 0000003f 0320f05c 26c718c0 2ad24b40 Instructions: (pc=0x100034fb) 0x100034eb: ff ff 8d 76 00 eb 02 89 f6 90 8b 45 f8 8b 55 f8 0x100034fb: 8b 4a 58 83 c9 04 89 48 58 83 c4 f8 8b 45 f8 8b Stack: [0x031c0000,0x03210000), sp=0x0320ef80, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rxtxSerial.dll+0x34fb] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j gnu.io.RXTXPort.writeByte(IZ)V+0 J gnu.io.RXTXPort$SerialOutputStream.write(I)V j consol_communication.Serial.acknowledge()V+6 J consol_communication.Serial.serialEvent(Lgnu/io/SerialPortEvent;)V j gnu.io.RXTXPort.sendEvent(IZ)Z+382 v ~StubRoutines::call_stub j gnu.io.RXTXPort.eventLoop()V+0 j gnu.io.RXTXPort$MonitorThread.run()V+12 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x03a58c00 JavaThread "ProcessingWorker92272" [_thread_blocked, id=3240] 0x02f3dc00 JavaThread "RMI TCP Connection(2352)-172.16.2.14" daemon [_thread_in_native, id=2212] 0x02ee6800 JavaThread "RMI TCP Connection(2347)-172.16.2.14" daemon [_thread_in_native, id=2620] 0x02f86000 JavaThread "RMI TCP Connection(1376)-172.16.2.14" daemon [_thread_blocked, id=2780] 0x03a7f400 JavaThread "JMX server connection timeout 76792" daemon [_thread_blocked, id=2440] 0x02f0ec00 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=1396] 0x02eda800 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2776] =>0x02b43400 JavaThread "Serial_StateMachine" [_thread_in_native, id=2436] 0x02e8f400 JavaThread "DisplayLog" [_thread_blocked, id=2720] 0x02e42c00 JavaThread "TimerQueue" daemon [_thread_blocked, id=2312] 0x003d6400 JavaThread "DestroyJavaVM" [_thread_blocked, id=984] 0x02aa9400 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=2920] 0x02b5f000 JavaThread "AWT-Windows" daemon [_thread_in_native, id=260] 0x02b5e000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3716] 0x02af7800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3592] 0x02a8cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3100] 0x02a88000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2952] 0x02a87000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3724] 0x02a86000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=992] 0x02a81800 JavaThread "Finalizer" daemon [_thread_blocked, id=2936] 0x02a7d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=376] Other Threads: 0x02a74000 VMThread [id=3568] 0x02a8e400 WatcherThread [id=3836] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 3008K, used 1230K [0x229a0000, 0x22ce0000, 0x22e80000) eden space 2688K, 33% used [0x229a0000, 0x22a83868, 0x22c40000) from space 320K, 100% used [0x22c90000, 0x22ce0000, 0x22ce0000) to space 320K, 0% used [0x22c40000, 0x22c40000, 0x22c90000) tenured generation total 39228K, used 22601K [0x22e80000, 0x254cf000, 0x269a0000) the space 39228K, 57% used [0x22e80000, 0x244927c0, 0x24492800, 0x254cf000) compacting perm gen total 12288K, used 5413K [0x269a0000, 0x275a0000, 0x2a9a0000) the space 12288K, 44% used [0x269a0000, 0x26ee9680, 0x26ee9800, 0x275a0000) ro space 8192K, 62% used [0x2a9a0000, 0x2ae9b9c8, 0x2ae9ba00, 0x2b1a0000) rw space 12288K, 52% used [0x2b1a0000, 0x2b7de348, 0x2b7de400, 0x2bda0000) Dynamic libraries: 0x00400000 - 0x00423000 C:\Program Files\Java\jre1.6.0\bin\javaw.exe 0x77f50000 - 0x77ff6000 C:\WINDOWS\System32\ntdll.dll 0x77e60000 - 0x77f40000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e5b000 C:\WINDOWS\system32\ADVAPI32.dll 0x78000000 - 0x7806f000 C:\WINDOWS\system32\RPCRT4.dll 0x77d40000 - 0x77dc6000 C:\WINDOWS\system32\USER32.dll 0x77c70000 - 0x77cae000 C:\WINDOWS\system32\GDI32.dll 0x7c340000 - 0x7c396000 C:\Program Files\Java\jre1.6.0\bin\msvcr71.dll 0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jre1.6.0\bin\client\jvm.dll 0x76b40000 - 0x76b6c000 C:\WINDOWS\System32\WINMM.dll 0x6d310000 - 0x6d318000 C:\Program Files\Java\jre1.6.0\bin\hpi.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\System32\PSAPI.DLL 0x6d770000 - 0x6d77c000 C:\Program Files\Java\jre1.6.0\bin\verify.dll 0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jre1.6.0\bin\java.dll 0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jre1.6.0\bin\zip.dll 0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jre1.6.0\bin\awt.dll 0x73000000 - 0x73023000 C:\WINDOWS\System32\WINSPOOL.DRV 0x77c10000 - 0x77c63000 C:\WINDOWS\system32\msvcrt.dll 0x76390000 - 0x763aa000 C:\WINDOWS\System32\IMM32.dll 0x771b0000 - 0x772c3000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada4000 C:\WINDOWS\system32\uxtheme.dll 0x51000000 - 0x5104d000 C:\WINDOWS\System32\ddraw.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\System32\DCIMAN32.dll 0x773d0000 - 0x77bbf000 C:\WINDOWS\system32\shell32.dll 0x772d0000 - 0x77334000 C:\WINDOWS\system32\SHLWAPI.dll 0x71950000 - 0x71a34000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_x-ww_1382d70a\comctl32.dll 0x77340000 - 0x773cb000 C:\WINDOWS\system32\comctl32.dll 0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jre1.6.0\bin\fontmanager.dll 0x6d570000 - 0x6d583000 C:\Program Files\Java\jre1.6.0\bin\net.dll 0x71ab0000 - 0x71ac5000 C:\WINDOWS\System32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\System32\WS2HELP.dll 0x6d590000 - 0x6d599000 C:\Program Files\Java\jre1.6.0\bin\nio.dll 0x71c20000 - 0x71c6d000 C:\WINDOWS\System32\netapi32.dll 0x71b20000 - 0x71b31000 C:\WINDOWS\system32\MPR.dll 0x75f60000 - 0x75f66000 C:\WINDOWS\System32\drprov.dll 0x71c10000 - 0x71c1c000 C:\WINDOWS\System32\ntlanman.dll 0x71cd0000 - 0x71ce6000 C:\WINDOWS\System32\NETUI0.dll 0x71c90000 - 0x71ccc000 C:\WINDOWS\System32\NETUI1.dll 0x71c80000 - 0x71c86000 C:\WINDOWS\System32\NETRAP.dll 0x71bf0000 - 0x71c01000 C:\WINDOWS\System32\SAMLIB.dll 0x75f70000 - 0x75f79000 C:\WINDOWS\System32\davclnt.dll 0x76670000 - 0x76754000 C:\WINDOWS\System32\SETUPAPI.dll 0x75f40000 - 0x75f5d000 C:\WINDOWS\system32\appHelp.dll 0x7c620000 - 0x7c6a1000 C:\WINDOWS\System32\CLBCATQ.DLL 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x77050000 - 0x77115000 C:\WINDOWS\System32\COMRes.dll 0x77c00000 - 0x77c07000 C:\WINDOWS\system32\VERSION.dll 0x76980000 - 0x76987000 C:\WINDOWS\System32\LINKINFO.dll 0x76990000 - 0x769b4000 C:\WINDOWS\System32\ntshrui.dll 0x76b20000 - 0x76b35000 C:\WINDOWS\System32\ATL.DLL 0x75a70000 - 0x75b13000 C:\WINDOWS\system32\USERENV.dll 0x10000000 - 0x10012000 C:\Documents and Settings\rommetveit\My Documents\console\rxtxSerial.dll 0x73d90000 - 0x73db7000 C:\WINDOWS\System32\crtdll.dll 0x6d220000 - 0x6d243000 C:\Program Files\Java\jre1.6.0\bin\dcpr.dll 0x6d350000 - 0x6d36a000 C:\Program Files\Java\jre1.6.0\bin\instrument.dll 0x71a50000 - 0x71a8b000 C:\WINDOWS\System32\mswsock.dll 0x76f20000 - 0x76f45000 C:\WINDOWS\System32\DNSAPI.dll 0x76fb0000 - 0x76fb7000 C:\WINDOWS\System32\winrnr.dll 0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll 0x76fc0000 - 0x76fc5000 C:\WINDOWS\System32\rasadhlp.dll 0x6d560000 - 0x6d569000 C:\Program Files\Java\jre1.6.0\bin\management.dll 0x0ffd0000 - 0x0fff2000 C:\WINDOWS\System32\rsaenh.dll 0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll 0x6d710000 - 0x6d716000 C:\Program Files\Java\jre1.6.0\bin\rmi.dll VM Arguments: jvm_args: -Djava.library.path=C:\Documents and Settings\rommetveit\My Documents\console java_command: consol_gui.GUI Launcher Type: SUN_STANDARD Environment Variables: PATH=C:\MinGW\bin;C:\msys\1.0\bin;c:\winavr\bin;c:\winavr\utils\bin;c:\inprise\vbroker\bin;c:\progra~1\borland\cbuild~1\bin;c:\progra~1\borland\cbuild~1\projects\bpl;c:\program files\cosmos applications;C:\Program Files\COSMOS Applications\Ems\bin;C:\Program Files\COSMOS Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;c:\program files\common files\ulead systems\mpeg;C:\Program Files\MATLAB\R2006a\bin\win32; USERNAME=rommetveit OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2 Memory: 4k page, physical 523276k(62292k free), swap 1280180k(830344k free) vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310 Regards Tarjei _________________________________________________________________ MSN Music http://music.msn.no Finn din favorittmusikk blant nesten 1 million låter From amarandon at e-xact.com Mon Jan 29 17:37:31 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 29 Jan 2007 16:37:31 -0800 Subject: [Rxtx] Bug in CommPortIdentifier.isCurrentlyOwned() ? Message-ID: <45BE934B.1090004@e-xact.com> Hi, I've got a problem with RxTx, I'm wondering if it's a bug or if I missed something. Consider the following test case: /* begin */ class ConnectSerial { static String portName = "/dev/ttyS0"; private static void report(CommPortIdentifier identifier) { System.out.println( String.format("--> %s is %s currently used.", portName, identifier.isCurrentlyOwned() ? "" : "NOT")); } public static void main(String[] args) throws NoSuchPortException, PortInUseException { // Opening the port a first time CommPortIdentifier identifier = CommPortIdentifier.getPortIdentifier(portName); report(identifier); CommPort port = identifier.open("foo", 2000); report(identifier); // Opening the same port a second time CommPortIdentifier identifier2 = CommPortIdentifier.getPortIdentifier(portName); report(identifier2); CommPort port2 = identifier2.open("foo", 2000); report(identifier2); } } /* end */ My concern is about the isCurrentlyOwned() method. The API doc says "Checks whether the port is owned." So my understanding is that the third call to isCurrentlyOwned(), after the port has been opened, should return true. But it returns false. However the following call to the open() method fails, as expected. Here is the output of this program on my machine: $ javac ConnectSerial.java && java ConnectSerial RXTXCommDriver loading /home/al/VirtualDebitFiles/librxtxSerial.so Experimental: JNI_OnLoad called. RXTXVersion loading /home/al/VirtualDebitFiles/librxtxSerial.so Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 CommPortIdentifier loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is NOT currently used. RXTXPort loading /home/al/VirtualDebitFiles/librxtxSerial.so --> /dev/ttyS0 is currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists --> /dev/ttyS0 is NOT currently used. RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists Exception in thread "main" gnu.io.PortInUseException: al PID = 8331 Program = java at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:371) at ConnectSerial.main(ConnectSerial.java:25) Any idea? Best regards, Alex From falko.guderian at gmx.de Tue Jan 30 03:31:05 2007 From: falko.guderian at gmx.de (Falko Guderian) Date: Tue, 30 Jan 2007 11:31:05 +0100 Subject: [Rxtx] Problems with serial port communication (baud rate) Message-ID: <45BF1E69.3030106@gmx.de> Hi Trent, It works. Thank you. Falko From thomas.shulok at lmco.com Tue Jan 30 17:30:05 2007 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Tue, 30 Jan 2007 19:30:05 -0500 Subject: [Rxtx] More fun with lock files Message-ID: <974B0BC4C9F3BB40B2651F8FC12B7B980DE09EBA@emss04m12.us.lmco.com> Hi All, I'm running rxtx 2.1-7 on i686 Linux, JDK1.4. Things are basically working, I can acquire ports and send/receive data. However, when I go to enumerate the ports via CommPortIdentifier:getPortIdentifiers() from the same app, but a different thread, I get RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS0: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS1: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS2: File exists RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyS3: File exists Is this expected behavior? Will one thread of an app lock out all the other threads of that same app? When I run the GNU version on an embedded XScale Linux box, I see this as well, but everything works fine if I use the javax version on XScale. Both GNU and javax versions give me the above behavior on i686 Linux. Many thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070130/2ea2d64a/attachment-0014.html From Martin.Oberhuber at windriver.com Wed Jan 31 11:16:53 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 31 Jan 2007 19:16:53 +0100 Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 Message-ID: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Hi all, sine we need rxtx for our product which is Eclipse based, I have prepared Eclipse plugins/fragments from the rxtx-2.1-7r2 binaries. If anybody is interested in these, I can E-Mail a ZIP archive (584 KB for linux (3 variants), solaris-sparc, macos and win32). These plugins work in Eclipse even if the JVM installation is not changed, i.e. it works with any vanilla JVM. Users of rxtx just do the following in their MANIFEST.MF: Import-Package: gnu.io or Require-Bundle: gnu.io.rxtx I'm interested in contributing these plugins to rxtx / Open Source such that everybody can use them. Ideally, rxtx.org would host some space on the downloads server which is organized like an Eclipse Update Site. Then, everybody can install and update rxtx into their Eclipse easily just by pointing to the update site. One big benefit of this is that only fragments for the required platform are downloaded. There's still some work to do: -) Fix about.html files and license / legal docs. Right now, all RXTX source is under RXTX license while the Eclipse meta-info files which I crafted are copyright Windriver and under EPL. This can be changed though, I think. -) Change the gnu.io.rxtx bundle to work as a single file jar (without nested jar; use layout recommendations from Eclipse Orbit project). -) Update the build to create a separate source feature/plugin -) Add fragments for other platforms -) Create a site.xml file for an Eclipse Update Site to easily get the stuff into Eclipse -) Define the minimum required execution environment (what does rxtx need? J2SE-1.4 or a smaller set of API? Would JavaME CDC-1.1 suffice? Trent thought that JDK1.02 worked originally, so even CLDC could work). -) Decide whether the gnu.io.rxtx bundle should be conditioned for pack200 / packed on an update site (wouldn't make much difference sine most is binary). I contacted Trent Jarvi directly regarding this already, and we'll have a phone meeting on Friday. I just wanted to make the community aware of this effort such that you can make comments if you want. Thanks, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Jan 31 11:44:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 31 Jan 2007 11:44:47 -0700 (MST) Subject: [Rxtx] Eclipse bundles and update site for rxtx-2.1-7r2 In-Reply-To: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858487F4141@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 31 Jan 2007, Oberhuber, Martin wrote: > Hi all, > > sine we need rxtx for our product which is Eclipse based, > I have prepared Eclipse plugins/fragments from the > rxtx-2.1-7r2 binaries. If anybody is interested in these, > I can E-Mail a ZIP archive (584 KB for linux (3 variants), > solaris-sparc, macos and win32). > > These plugins work in Eclipse even if the JVM installation > is not changed, i.e. it works with any vanilla JVM. Users > of rxtx just do the following in their MANIFEST.MF: > Import-Package: gnu.io > or > Require-Bundle: gnu.io.rxtx > > I'm interested in contributing these plugins to rxtx / > Open Source such that everybody can use them. Ideally, > rxtx.org would host some space on the downloads server > which is organized like an Eclipse Update Site. Then, > everybody can install and update rxtx into their Eclipse > easily just by pointing to the update site. One big > benefit of this is that only fragments for the required > platform are downloaded. > > There's still some work to do: > -) Fix about.html files and license / legal docs. > Right now, all RXTX source is under RXTX license > while the Eclipse meta-info files which I crafted > are copyright Windriver and under EPL. This can > be changed though, I think. > -) Change the gnu.io.rxtx bundle to work as a single > file jar (without nested jar; use layout recommendations > from Eclipse Orbit project). > -) Update the build to create a separate source > feature/plugin > -) Add fragments for other platforms > -) Create a site.xml file for an Eclipse Update Site > to easily get the stuff into Eclipse > -) Define the minimum required execution environment > (what does rxtx need? J2SE-1.4 or a smaller set > of API? Would JavaME CDC-1.1 suffice? Trent thought > that JDK1.02 worked originally, so even CLDC could > work). > -) Decide whether the gnu.io.rxtx bundle should be > conditioned for pack200 / packed on an update site > (wouldn't make much difference sine most is binary). > > I contacted Trent Jarvi directly regarding this already, > and we'll have a phone meeting on Friday. I just wanted > to make the community aware of this effort such that > you can make comments if you want. > For everyones info... As far as I know, we will discuss the bits about rxtx.org hosting the files and the license change currently in rxtx 2.0 that removes any confusion about linking to rxtx and should be in rxtx 2.1 as well. http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface Otherwise this has been news to me also. There has been discussion from Eclipse.org in the past but nothing one way or another. If anything is proposed to change it will be sent here for community feedback first. -- Trent Jarvi tjarvi at qbang.org From gruhop-rxtx at yahoo.com Wed Jan 31 18:47:12 2007 From: gruhop-rxtx at yahoo.com (gruhop-rxtx@yahoo.com) Date: Wed, 31 Jan 2007 17:47:12 -0800 (PST) Subject: [Rxtx] Error 0x5... Message-ID: <20070201014712.17046.qmail@web55011.mail.re4.yahoo.com> I have an application which connects to an embedded device via the serial port. I was using Java Comm API, but a few months ago a strange thing started to happen--if we unplugged the embedded device, and then plug it back in, the Java application would go into an infinite loop with an error message that was not part of my code--I assume it was from the DLL or Java Comm API classes, but I am uncertain. So, today I installed RXTX and tried it, and it does much the same thing (although, to my surprise, it worked just by changing the import statements--cool.). I get error message like this over and over again: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(2714): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(1468): Access is denied I also get an IOException. I tried to catch the exception and close the port when this happened, but that doesn't seem to work because it seems to hang on the line of code where I try to close the port. Here is a possible clue: I thought the error started out of the blue, but I just found out that the device has been connected through USB for several months. I was not told this until today, so I thought the problem had to be with the hardware/software on the embedded device, since my code had not changed. But since the change to using the USB might have occurred around the same time, I am starting to think this has something to do with it. I have no idea how that works, but I guess there is some driver that converts the serial to USB to send and recieve. So, any ideas? ------------------------------- Chuck Cusack Visiting Assistant Professor Department of Computer Science Hope College 27 Graves Place Holland, MI 49423 From lyon at docjava.com Mon Jan 1 07:48:32 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 01 Jan 2007 09:48:32 -0500 Subject: [Rxtx] JAVA 1.6 Compatibility? In-Reply-To: <459814E1.4070709@copyrightwitness.net> References: <4592194E.1060501@telus.net> <45966D6C.10105@copyrightwitness.net> <459814E1.4070709@copyrightwitness.net> Message-ID: Hi All, I have been using: public static void pathHack() throws NoSuchFieldException, IllegalAccessExce ption { Class loaderClass = ClassLoader.class; Field userPaths = loaderClass.getDeclaredField("sys_paths"); userPaths.setAccessible(true); userPaths.set(null, null); userPaths.setAccessible(true); userPaths.set(null, null); } To enable a writable java.library.path, but the appendPath, below, looks much nicer. However, the pathHack should be called only once, where-as the appendPath introspection is done every time you append to the path. >>> >>> >>>public static void appendPath(String pathname) throws SecurityException, >>>NoSuchFieldException, IllegalArgumentException, IllegalAccessException >>> { >>> Class clsLoader = ClassLoader.class; >>> Field field = clsLoader.getDeclaredField("sys_paths"); >>> String libPath = new >>>String(System.getProperty("java.library.path")); >>> >>> >>> if (!field.isAccessible()) >>> { >>> field.setAccessible(true); >>> } >>> >>> // >>> // Reset the sys_paths field in the class loader to null so that >>> // whenever "System.loadLibrary" is called it will be reconstructed >>> // with the changed value. >>> // >>> field.set(clsLoader, null); >>> >>> if (!libPath.endsWith(System.getProperty("path.separator"))) >>> { >>> libPath = libPath.concat(System.getProperty("path.separator")); >>> } >>> >>> System.setProperty("java.library.path", libPath.concat(pathname)); >>> } >>> >>>Like I said not nice but unless someone else knows another way... Well, the approach I presently use is not pretty either...but it is another way, I suppose. - DL From jimo at earthlink.net Sun Jan 7 22:48:46 2007 From: jimo at earthlink.net (Jim Owen) Date: Sun, 7 Jan 2007 21:48:46 -0800 Subject: [Rxtx] SCO Binaries? Message-ID: <000001c732e8$abf881a0$03e984e0$@net> Hi All, I've been trying to get a clean build of rxtx on SCO Unix 5.0.7 for many weeks without any success. Does anyone know where I can get a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x release? Thanks, Jim Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070107/71ed4972/attachment-0015.html From tjarvi at qbang.org Mon Jan 8 03:33:53 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 8 Jan 2007 03:33:53 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <000001c732e8$abf881a0$03e984e0$@net> References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org From jimo at earthlink.net Mon Jan 8 23:37:41 2007 From: jimo at earthlink.net (Jim Owen) Date: Mon, 8 Jan 2007 22:37:41 -0800 Subject: [Rxtx] SCO Binaries? In-Reply-To: References: <000001c732e8$abf881a0$03e984e0$@net> Message-ID: <004801c733b8$a9b41960$fd1c4c20$@net> Hi Trent, I was able to get an apparently clean build of rxtx 2.0.5, but when I executed a very simply enumeration of the ports, I get the following error: # java VerifyCommBuild Verifying Comm Build Environment Caught java.lang.UnsatisfiedLinkError: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: relocation error: symbol not found: _runtime_env; referenced from: /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so while loading driver gnu.io.RXTXCommDriver Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver com.sun.comm.SolarisDriver Some ports appear to have been found, let's try to enumerate them. Complete. I've never encountered a missing reference to _runtime_env and was not able to find much on the net regarding it. I've done a bit of looking for the sco binaries and have not been able to find them yet - I'll look a bit more and see what sco says when I ask them. I suspect that the problems I've been running into with the SCO build have to do with the order in which include directories are searched since fiddling with that eventually gave me the clean build. Based on that, I might simply need to change the order in which the library directories are loaded. But I just don't have much experience with sco and have not been able to get around it. Thanks for the help, - Jim -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Trent Jarvi Sent: Monday, January 08, 2007 2:34 AM To: RXTX Developers and Users Subject: Re: [Rxtx] SCO Binaries? On Sun, 7 Jan 2007, Jim Owen wrote: > Hi All, > > > > I've been trying to get a clean build of rxtx on SCO Unix > 5.0.7 for many weeks without any success. Does anyone know where I can get > a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x > release? > > Hi Jim The only binaries I know of from The SCO Group are mentioned in the Unixware update: http://www.sco.com/ta/125740 " New Java support for RS-232 serial I/O and IEEE javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX 1.4-8 " Those used to be available for download but I didn't find them in a quick search. I don't think all of the fixes got back to rxtx.org which is their option. They didn't offer the source code for download with the binaries so one would have to request that if you can find the download. They would have to provide the modified source then. I didn't see any comments after the include file fixes. What was the last problem you ran into? Lack of access to these system makes it impossible to know what you ran into. -- Trent Jarvi tjarvi at qbang.org _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From a.giannini at infinito.it Tue Jan 9 00:54:01 2007 From: a.giannini at infinito.it (Armando Giannini) Date: Tue, 9 Jan 2007 08:54:01 +0100 Subject: [Rxtx] RXTX on Windows Mobile Message-ID: Hi, guys, I'm Armando, a newcomer of this mailing list. I'm writing a java application for my pocket pc to communicate with several instruments through the serial port. Looking for a serial native library for JDK I found RXTX. It looks a good product, but for how I read I'm not sure which package to use. Really I tried a couple of installations, but with no success and now I'm a little confused... My device is an Asus A620BT, OS Windows Mobile 2003. The serial port is Com8, located on a Socket Communication compact flash. Does anyone suggest me what to do? Thanks in advance, Armando Giannini From vt at freehold.crocodile.org Tue Jan 9 01:05:23 2007 From: vt at freehold.crocodile.org (Vadim Tkachenko) Date: Tue, 09 Jan 2007 01:05:23 -0700 Subject: [Rxtx] About to hit the fan: UTS_RELEASE Message-ID: <45A34CC3.5020803@freehold.crocodile.org> Hello all, Trying to compile latest and greatest RxTx with latest and greatest Linux kernel - checking os.version 2.6.18-1.2869.fc6 conftest.c: In function 'main': conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:8: error: (Each undeclared identifier is reported only once conftest.c:8: error: for each function it appears in.) conftest.c:8: error: expected ')' before string constant ./configure: line 21462: ./conftest: No such file or directory ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected Apparently, UTS_RELEASE was being deprecated for quite some time - first moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), and now (as of 2869) is gone completely, replaced by system_utsname. It's getting late here, no time to figure out the solution now - feel free to poke it with a sharp stick while I get some sleep. --vt From tjarvi at qbang.org Tue Jan 9 05:05:34 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 05:05:34 -0700 (MST) Subject: [Rxtx] About to hit the fan: UTS_RELEASE In-Reply-To: <45A34CC3.5020803@freehold.crocodile.org> References: <45A34CC3.5020803@freehold.crocodile.org> Message-ID: On Tue, 9 Jan 2007, Vadim Tkachenko wrote: > Hello all, > > Trying to compile latest and greatest RxTx with latest and greatest > Linux kernel - > > checking os.version 2.6.18-1.2869.fc6 > conftest.c: In function 'main': > conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:8: error: (Each undeclared identifier is reported only once > conftest.c:8: error: for each function it appears in.) > conftest.c:8: error: expected ')' before string constant > ./configure: line 21462: ./conftest: No such file or directory > ./configure: line 21462: test: 2.6.18-1.2869.fc6: unary operator expected > > > Apparently, UTS_RELEASE was being deprecated for quite some time - first > moved into utsrelease.h (seen last in kernels 2798 and 2849 at my box), > and now (as of 2869) is gone completely, replaced by system_utsname. > > It's getting late here, no time to figure out the solution now - feel > free to poke it with a sharp stick while I get some sleep. > Hi Vadim One other thing you may notice with the very latest kernels [probably not in distros yet] is termios support is a bit different. The custom baud rate code in rxtx will need to be replaced with something more sane. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 9 19:06:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 9 Jan 2007 19:06:39 -0700 (MST) Subject: [Rxtx] SCO Binaries? In-Reply-To: <004801c733b8$a9b41960$fd1c4c20$@net> References: <000001c732e8$abf881a0$03e984e0$@net> <004801c733b8$a9b41960$fd1c4c20$@net> Message-ID: Hi Jim You will need to use CommAPI 2.0 with rxtx 2.0.5. It appears you have the javax.comm.properties file properly installed but CommAPI is still trying to load Solaris .so files. This is probably a known issue: http://mailman.qbang.org/pipermail/rxtx/20051216/001960.html The reason I assume javax.comm.properties is properly installed is RXTXCommDriver appears to be loaded by CommAPI I can't imagine why CommAPI is trying to load Sun's native lib otherwise. The _runtime_env would appear to be a compile/link problem that needs to be resolved in your build of rxtx. Digging through the dirty underwear of yesteryear, I may have found a hint: http://groups.google.com/group/gnu.gcc.help/browse_thread/thread/a6bb301683013445/789ff477c2a0ff87 It appears there used to be a free Skunkware CD with a working gcc. The links are all ten years old and dead though. I suspect helloworld.c will not run when compiled with your current cc. On Mon, 8 Jan 2007, Jim Owen wrote: > Hi Trent, > > I was able to get an apparently clean build of rxtx 2.0.5, but when > I executed a very simply enumeration of the ports, I get the following > error: > > # java VerifyCommBuild > Verifying Comm Build Environment > Caught java.lang.UnsatisfiedLinkError: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so: dynamic linker: java: > relocation error: symbol not found: _runtime_env; referenced from: > /opt/java2-1.4.2/jre/lib/i386/librxtxSerial.so > while loading driver gnu.io.RXTXCommDriver > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialParallel in java.library.path > Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading > driver com.sun.comm.SolarisDriver > Some ports appear to have been found, let's try to enumerate them. > Complete. > > I've never encountered a missing reference to _runtime_env and was > not able to find much on the net regarding it. > > I've done a bit of looking for the sco binaries and have not been > able to find them yet - I'll look a bit more and see what sco says when I > ask them. > > I suspect that the problems I've been running into with the SCO > build have to do with the order in which include directories are searched > since fiddling with that eventually gave me the clean build. Based on that, > I might simply need to change the order in which the library directories are > loaded. But I just don't have much experience with sco and have not been > able to get around it. > > Thanks for the help, > > - Jim > > > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Trent Jarvi > Sent: Monday, January 08, 2007 2:34 AM > To: RXTX Developers and Users > Subject: Re: [Rxtx] SCO Binaries? > > On Sun, 7 Jan 2007, Jim Owen wrote: > >> Hi All, >> >> >> >> I've been trying to get a clean build of rxtx on SCO Unix >> 5.0.7 for many weeks without any success. Does anyone know where I can > get >> a set of binaries of RXTX for SCO 5.0.7 pretty much any build in the 2.0.x >> release? >> >> > > Hi Jim > > The only binaries I know of from The SCO Group are mentioned in the > Unixware update: > > http://www.sco.com/ta/125740 > > " > New Java support for RS-232 serial I/O and IEEE > javaxcomm package 1284 parallel I/O based on Sun COMM 2.0 and RXTX > 1.4-8 > " > > Those used to be available for download but I didn't find them in a quick > search. I don't think all of the fixes got back to rxtx.org which is > their option. They didn't offer the source code for download with the > binaries so one would have to request that if you can find the download. > They would have to provide the modified source then. > > I didn't see any comments after the include file fixes. What was the last > problem you ran into? Lack of access to these system makes it impossible > to know what you ran into. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > 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 david.sayada at hyperms.com Mon Jan 1 08:41:27 2007 From: david.sayada at hyperms.com (David Sayada) Date: Mon, 1 Jan 2007 17:41:27 +0200 Subject: [Rxtx] SIGSEGV Message-ID: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Hi, I am building a java application on an ARM (PXA) platform using GCJ (and CNI) and on top of SQLite wrapper and RXTX. The application is running a certain amount of time and then killed by signal SIGSEGV. As I have read in the mailing list, the issue is already known but I could not find a clear way to fix it. Maybe somebody can tell me how to avoid that? I am using rxtx-2.1-7r2. Best Regards, David Sayada. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070101/fc0582a9/attachment-0015.html From tjarvi at qbang.org Thu Jan 11 19:10:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 11 Jan 2007 19:10:08 -0700 (MST) Subject: [Rxtx] SIGSEGV In-Reply-To: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> References: <001701c72dbb$56141740$7c7ba8c0@davidlaptop> Message-ID: On Mon, 1 Jan 2007, David Sayada wrote: > Hi, > > > > I am building a java application on an ARM (PXA) platform using GCJ (and > CNI) and on top of SQLite wrapper and RXTX. The application is running a > certain amount of time and then killed by signal SIGSEGV. As I have read in > the mailing list, the issue is already known but I could not find a clear > way to fix it. Maybe somebody can tell me how to avoid that? > > > > I am using rxtx-2.1-7r2. > > > Hi David I ran into SIGSEGV with older glibcs that did not match the kernel termios information. That should be fixed in both rxtx and glibc now but the CNI code in rxtx probably still includes the kernel header. So I was using the kernel header for needed information but then recieved a glibc struct of a different size resulting in problems. -- Trent Jarvi tjarvi at qbang.org From lengyel at gmail.com Sun Jan 14 21:01:36 2007 From: lengyel at gmail.com (FL) Date: Sun, 14 Jan 2007 23:01:36 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 Message-ID: This is what happens when I attempt to run make install on a debian linux system. I'm using jdk1.6.0. Make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 Is there a fix? Thanks. -FL -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070114/dbdd3df9/attachment-0015.html From lists at java-system.com Mon Jan 15 10:08:29 2007 From: lists at java-system.com (Marco Tozzini) Date: Mon, 15 Jan 2007 18:08:29 +0100 Subject: [Rxtx] RxTx on OpenWRT (mipsel,uclibc) Message-ID: <45abb50d.12.1c02.2045531469@webmailh3.aruba.it> Finally I was able to create a good crosscompile makefile for OpenWRT environment RxTx compiles correctly with no error Now I have to correctly install the generated code.... OpenWRT has available sablevm sablevm has customized sable-classpath Here they are current sablevm installation paths: sable binaries -> /usr/bin libsablevm*.so -> /usr/lib sable-classpath files are installed in: libjava*.so -> /usr/lib/sablevm-classpath/ classpath.security -> /usr/lib/security/ libclasspath.jar -> /usr/share/sablevm-classpath/ resources}.jar -> /usr/share/sablevm-classpath/ further seems to be a libffi code in ffi{,target}.h -> /usr/include/ libffi.{a,so*} -> /usr/lib/ For what I know, RxTx compile process generates 2 interesting files RXTXcomm.jar and librxtxSerial.so Where do you think they must be placed for such sablevm environment? Ciao Marco From mklein at vxappliance.com Mon Jan 15 16:38:19 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 15:38:19 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... Message-ID: <45AC106B.2060700@vxappliance.com> Myth w/lirc was like 100 times easier than rxtx. I'm basically ready to put bullet in head. No FAQ/Wiki even gets me close to installing this stupid package. I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. I have tried faqs which say to use solaris/sparc javacomm and those that didn't. Neither work. Using one faq I got up to point "cannot create lock file"... Faqs reference "you must be in uucp and lock groups"....I have neither of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* is rw by all. Yet rxtx wouldn't init until I FORCED uucp as group on dev files and lock as group on /var/lock. This makes no sense as I had no problems as uucp/lock user creating files in these directories/etc. Software wouldn't get farther until I gratuitously chgrp'd these files. Now I am getting Unsatisified link errors. This would indicate a mismatch between comm/rxtx jars and libs....but I've tried every %$#!**$ combination and get one working right. Can I get a url from somebody referencing a TRULY CLEAN install document? I don't want to buy SerialIO (Although they are cheap and quality)...cause I don't even know how much I'll even be using direct serial in my apps....will prob' end up going over ethernet and using virtual com ports.... For now I want rxtx working...but it's a no go. From amarandon at e-xact.com Mon Jan 15 17:15:21 2007 From: amarandon at e-xact.com (Alex Marandon) Date: Mon, 15 Jan 2007 16:15:21 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: <45AC1919.7040307@e-xact.com> Mike Klein wrote: > For now I want rxtx working...but it's a no go. > It seems to me that you should go for a walk, or take a nap, or anything that make you relaxed and able to analyze the situation, but for god's sake, relax and try to be more friendly, nobody here owes you anything. Installing RxTx on Ubuntu is no problem at all, weather using a package or from the source. The documentation material accessible from the website is pretty good. From sjudd at seas.upenn.edu Mon Jan 15 17:41:49 2007 From: sjudd at seas.upenn.edu (Stephen Judd) Date: Mon, 15 Jan 2007 19:41:49 -0500 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> "pretty good" documentation? not when I tried a few months ago. I got myself into a totally abortive snit like Klein's, but suppressed it. Maybe I shouldn't have. I think we should hire a professional technical writer to try to sort this jumble out. Unfortunately it might be very expensive, given its state of multiply- elaborated confusion. That offensive front page at http://www.rxtx.org/ is simply inexcusable. Sorry Trent. Your self-effacing comment about "not being good at documentation" and your well-appreciated good will do not compensate for the damage that is done to your efforts by the state of the words around it. Sadly but sincerely, sj On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > Mike Klein wrote: >> For now I want rxtx working...but it's a no go. >> > It seems to me that you should go for a walk, or take a nap, or > anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you > anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a > package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From lyon at docjava.com Mon Jan 15 18:21:20 2007 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 15 Jan 2007 20:21:20 -0500 Subject: [Rxtx] Article idea In-Reply-To: <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi All, Is anyone interested in co-authoring an article about this topic? I would be psyched to collaborate with a co-author or two. Please contact me off-line and we can try to start with an outline. Thanks! - DL >"pretty good" documentation? not when I tried a few months ago. > >I got myself into a totally abortive snit like Klein's, but? >suppressed it. >Maybe I shouldn't have. > >I think we should hire a professional technical writer to try to sort? >this jumble out. >Unfortunately it might be very expensive, given its state of multiply- >elaborated confusion. >That offensive front page at http://www.rxtx.org/ is simply inexcusable. >Sorry Trent. Your self-effacing comment about "not being good at? >documentation" >and your well-appreciated good will do not compensate for the damage? >that >is done to your efforts by the state of the words around it. > >Sadly but sincerely, >sj > > >On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: > >> Mike Klein wrote: >>> For now I want rxtx working...but it's a no go. >>> >> It seems to me that you should go for a walk, or take a nap, or? >> anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you? >> anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a? >> package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 mklein at vxappliance.com Mon Jan 15 18:26:00 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:26:00 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC1919.7040307@e-xact.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> Message-ID: <45AC29A8.4020502@vxappliance.com> Ok...I took off on motorcycle...all better now. What install doc can I reference for Ubuntu (if this matters) install of RXTX on i386? I found that apt had a rxtx package for Ubuntu...but it installs into /usr/lib (where base jre is) and not in spot for my own jdk. Big deal...s/just be able to copy some jars/libs over and it s/still work. Even trying to tweak rxtx ubuntu pkg yielded same results (either uucp/lock user issue or dep issue). I have 6+ years of installing/configuring/building linux software and know how to follow directions. I certainly don't "make stuff up"...I follow the INSTALL/README. Doing this didn't yield success for any particular path. If somebody can point me to one url in particular (or pkg provided by ubuntu) and say "use this pkg" and it s/work. I will do this again and post specific results. mike Alex Marandon wrote: > Mike Klein wrote: > >> For now I want rxtx working...but it's a no go. >> >> > It seems to me that you should go for a walk, or take a nap, or anything > that make you relaxed and able to analyze the situation, but for god's > sake, relax and try to be more friendly, nobody here owes you anything. > > Installing RxTx on Ubuntu is no problem at all, weather using a package > or from the source. The documentation material accessible from the > website is pretty good. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mklein at vxappliance.com Mon Jan 15 18:49:56 2007 From: mklein at vxappliance.com (Mike Klein) Date: Mon, 15 Jan 2007 17:49:56 -0800 Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC29A8.4020502@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <45AC29A8.4020502@vxappliance.com> Message-ID: <45AC2F44.8000502@vxappliance.com> I removed all added stuff from jre/lib, jre/lib/ext and jre/lib/i386. Re-installed rxtx pkg for Ubuntu. As I mentioned...it isn't configured by default (obviously) for my jdk 1.5 in /opt/java/jdk. So I copied rxtx SOs in /usr/lib to /lib/i386 and RXTXComm.jar to /lib/ext. I edited javax.comm.properties in /lib so driver used is gnu.io.RXTXCommDriver. I believe javacomm I'm working with is one marked for Linux (not portable or solaris/sparc version). When I run my application I get below errors: Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java 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 com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) Exception in thread "main" java.lang.UnsatisfiedLinkError: isDevLink at com.sun.comm.Unix.isDevLink(Native Method) at com.sun.comm.PathBundle.add(PathBundle.java:108) at com.sun.comm.PlatformPortBundle.(PlatformPortBundle.java:44) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at com.vxappliance.jasm.common.server.J2SEServerImpl.initializeChildren(J2SEServerImpl.java:103) at com.vxappliance.jasm.common.hardware.ControllerImpl.added(ControllerImpl.java:166) at com.vxappliance.jasm.common.schedule.MapImpl.addComponent(MapImpl.java:349) at com.vxappliance.jasm.common.schedule.MapImpl.(MapImpl.java:148) at com.vxappliance.jasm.clients.j2se.MapBuilder.(MapBuilder.java:67) at com.vxappliance.jasm.clients.j2se.MapBuilder.main(MapBuilder.java:1726) mike Mike Klein wrote: > Ok...I took off on motorcycle...all better now. > > What install doc can I reference for Ubuntu (if this matters) install of > RXTX on i386? > > I found that apt had a rxtx package for Ubuntu...but it installs into > /usr/lib (where base jre is) and not in spot for my own jdk. Big > deal...s/just be able to copy some jars/libs over and it s/still work. > > Even trying to tweak rxtx ubuntu pkg yielded same results (either > uucp/lock user issue or dep issue). > > I have 6+ years of installing/configuring/building linux software and > know how to follow directions. I certainly don't "make stuff up"...I > follow the INSTALL/README. > > Doing this didn't yield success for any particular path. > > If somebody can point me to one url in particular (or pkg provided by > ubuntu) and say "use this pkg" and it s/work. I will do this again and > post specific results. > > > mike > > Alex Marandon wrote: > >> Mike Klein wrote: >> >> >>> For now I want rxtx working...but it's a no go. >>> >>> >>> >> It seems to me that you should go for a walk, or take a nap, or anything >> that make you relaxed and able to analyze the situation, but for god's >> sake, relax and try to be more friendly, nobody here owes you anything. >> >> Installing RxTx on Ubuntu is no problem at all, weather using a package >> or from the source. The documentation material accessible from the >> website is pretty good. >> _______________________________________________ >> 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 tjarvi at qbang.org Mon Jan 15 18:51:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 18:51:54 -0700 (MST) Subject: [Rxtx] Pulling hair on rxtx ubuntu install... In-Reply-To: <45AC106B.2060700@vxappliance.com> References: <45AC106B.2060700@vxappliance.com> Message-ID: On Mon, 15 Jan 2007, Mike Klein wrote: > Myth w/lirc was like 100 times easier than rxtx. > > I'm basically ready to put bullet in head. No FAQ/Wiki even gets me > close to installing this stupid package. > > I am running Ubuntu 6.1 and wanting to use RXTX which requires commapi. > > I have tried faqs which say to use solaris/sparc javacomm and those that > didn't. Neither work. > > Using one faq I got up to point "cannot create lock file"... > > Faqs reference "you must be in uucp and lock groups"....I have neither > of these groups in my system and /var/lock is rw by ugo and /dev/ttyS* > is rw by all. > Hi Mike I'm well aware that documentation in rxtx is lacking. We could use help. The rxtx wiki is editable by anyone. I'll be glad to include the changes in the next rxtx documentation and point back to the wiki. I'd love to just do rxtx but thats not an option. It is all I can do to provide the current availability right now. If you don't mind, lets look at the problem for a second. Going the Sun CommAPI route is a bad choice for several reasons. RXTX fully supports Sun's Java efforts but their CommAPI ran into a corner [Sun's doing] that only a JSR will fix. We [the rxtx community] even express interest in helping there. If things go well, which I now expect, we'll have a 'kicker to boot.' But thats not interesting because you have no serial love today :). I hear ya. As for the above error, you may well have found something I'm not aware of. You can configure with --disable-lockfiles. But really, I'm interested in seeing who owns the /var/lock dir on your system though. ls -ld /var/lock This is something of a developer issue you ran into. Since the last release, the Mac OS X rxtx developers ran into a clubie hint from Apple. Apple revealed a way to do what locking does without lockfiles. More to come, but I'm looking at it with production systems in mind and will share the results. Finally, I would encourage developers at Ubuntu to work out a solution [package rxtx] for their users that are now using what is now open source java. Debian has done it for years. Ubuntu is based off Debian if I recall right. I realize Ubuntu is a popular distro. But the problem faced is one of many popular distros. At some point the distros have to share the load so some of us can focus on the problems not specific to a distro. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Jan 15 19:03:47 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 19:03:47 -0700 (MST) Subject: [Rxtx] Article idea In-Reply-To: References: <45AC106B.2060700@vxappliance.com> <45AC1919.7040307@e-xact.com> <65248E5A-47DB-4891-91F9-FD70D4337609@seas.upenn.edu> Message-ID: Hi Doug, I can help someone out by answering questions but not enough to be a co-author. Anyone willing to do it should get the credit. On Mon, 15 Jan 2007, Dr. Douglas Lyon wrote: > Hi All, > Is anyone interested in co-authoring an article about > this topic? I would be psyched to collaborate with a co-author > or two. Please contact me off-line and we can try to start with > an outline. > Thanks! > - DL > >> "pretty good" documentation? not when I tried a few months ago. >> >> I got myself into a totally abortive snit like Klein's, but? >> suppressed it. >> Maybe I shouldn't have. >> >> I think we should hire a professional technical writer to try to sort? >> this jumble out. >> Unfortunately it might be very expensive, given its state of multiply- >> elaborated confusion. >> That offensive front page at http://www.rxtx.org/ is simply inexcusable. >> Sorry Trent. Your self-effacing comment about "not being good at? >> documentation" >> and your well-appreciated good will do not compensate for the damage? >> that >> is done to your efforts by the state of the words around it. >> >> Sadly but sincerely, >> sj >> >> >> On 2007 Jan 15, at 7:15 PM, Alex Marandon wrote: >> >>> Mike Klein wrote: >>>> For now I want rxtx working...but it's a no go. >>>> >>> It seems to me that you should go for a walk, or take a nap, or? >>> anything >>> that make you relaxed and able to analyze the situation, but for god's >>> sake, relax and try to be more friendly, nobody here owes you? >>> anything. >>> >>> Installing RxTx on Ubuntu is no problem at all, weather using a? >>> package >>> or from the source. The documentation material accessible from the >>> website is pretty good. >>> _______________________________________________ >>> 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 > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From lengyel at gmail.com Mon Jan 15 21:07:00 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:07:00 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: I would think that modifying configure.in so that case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|) becomes case $JAVA_VERSION in 1.2*|1.3*|1.4*|1.5*|1.6*) would result in these variables being set: JHOME=$JPATH"/jre/lib/ext" RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" Sadly, the Makefile still leaves JHOME undefined. On 1/14/07, FL wrote: > > > > > This is what happens when I attempt to run > make install on a debian linux system. I'm using jdk1.6.0. > > > Make[1]: Nothing to be done for `all-am'. > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 > > Is there a fix? Thanks. > > -FL > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/d1f51624/attachment-0015.html From lengyel at gmail.com Mon Jan 15 21:17:57 2007 From: lengyel at gmail.com (FL) Date: Mon, 15 Jan 2007 23:17:57 -0500 Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: Here's the fix modify configure.in so that > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|) > > becomes > > case $JAVA_VERSION in > > 1.2*|1.3*|1.4*|1.5*|1.6* ) then run ./autogen.sh to create a new configure script > > This now has the expected variables set: > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) and JHOME=/usr/local/java/jdk/jre/lib/ext I learned somthing -- I hate when that happens. On 1/14/07, FL wrote: > > > > > > > > > > This is what happens when I attempt to run > > make install on a debian linux system. I'm using jdk1.6.0. > > > > > > Make[1]: Nothing to be done for `all-am'. > > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' > > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory > > Try `libtool --help --mode=install' for more information. > > make: *** [install] Error 1 > > > > Is there a fix? Thanks. > > > > -FL > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070115/85a560ff/attachment-0015.html From tjarvi at qbang.org Mon Jan 15 21:51:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 15 Jan 2007 21:51:21 -0700 (MST) Subject: [Rxtx] Makefile installation fails on debian unstable w/ jdk 1.6 In-Reply-To: References: Message-ID: On Mon, 15 Jan 2007, FL wrote: > Here's the fix > > modify configure.in so that >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|) >> >> becomes >> >> case $JAVA_VERSION in >> >> 1.2*|1.3*|1.4*|1.5*|1.6* ) > > > > then run ./autogen.sh to create a new configure script > >> >> This now has the expected variables set: >> > RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) > and > JHOME=/usr/local/java/jdk/jre/lib/ext > > > I learned somthing -- I hate when that happens. > > > On 1/14/07, FL wrote: >> > >> > >> > >> > >> > This is what happens when I attempt to run >> > make install on a debian linux system. I'm using jdk1.6.0. >> > >> > >> > Make[1]: Nothing to be done for `all-am'. >> > make[1]: Leaving directory `/home/flengyel/Downloads/rxtx- 2.1-7r2' >> > libtool: install: `i686-pc-linux-gnu/librxtxRS485.la' is not a directory >> > Try `libtool --help --mode=install' for more information. >> > make: *** [install] Error 1 >> > >> > Is there a fix? Thanks. >> > >> > -FL >> > >> >> > Hi 'FL' Yes, this is the proper fix. It will be in the next release. fwiw, the real proper fix is to see if we are using really old JREs. There are many things going on right now and they do involve rxtx directly. I just can't comment right now but things look good. I appologize for the 'holding orbit.' If I thought I was wasting everyones time, I'd say so ASAP. -- Trent Jarvi tjarvi at qbang.org From m.zach at tin.it Tue Jan 16 07:43:57 2007 From: m.zach at tin.it (m.zach@tin.it) Date: Tue, 16 Jan 2007 15:43:57 +0100 (GMT+01:00) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted Message-ID: <1102b5d4518.m.zach@tin.it> Hello... a month ago...I came to know about this wonderful library. I've been using it in a Laptop Windows XP with a serial port in a PCMCI. I have dimensioned a buffer [113] bytes. I noticed that i receive well all data in a baud rate of 9600. When I increased teh dimension of the buffer to 221 and 413 I don't receive anymore all data as transmitted from the other side.Some time data is lost. Can you please tell me what do I do wong. Can you give me a hint. Thanks to all. From hentyw at ipay.co.za Tue Jan 16 07:47:43 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Tue, 16 Jan 2007 16:47:43 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. Message-ID: <200701161647.43742.hentyw@ipay.co.za> Hi there We have a java application (jdk1.5) that talks to a parallell printer and serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, no-parity) We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application jar on both platforms. Under rxtx: 1)It's working fine on Linux. 2)Only the parallell port is working under Windows (XP). Serial does not work. Under javacomm: (after changing import gnu.io to javax.comm) parallell and serial work fine under windows. More details of failure of rxtx on Windows XP: 1) It failed on a fresh XP system before sun's javacomm was installed. 2) Tried with both std serial port and usb-serial converter. Both failed. 3) Startup reports no error messages when correct port is used. 4) Startup reports error message if port is used by another application. 5) Startup reports error message if invalid port is used. I imagine this is not enough info to offer me much advice, but can someone tell me how to get more debug info out of rxtx? Thanks Henty Code snippet: magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); public class EmbeddedMagtekMt85 implements SerialPortEventListener, MagCardDevice { private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long enough to open serial port. private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded timeout for encoding magnetic stripe. private static final byte STX = 0x02; private static final byte ETX = 0x03; private static final byte NAK = 0x15; private static final byte ESC = 0x1B; // Constants for parity. public static final int PARITY_NONE = 0; public static final int PARITY_ODD = 1; public static final int PARITY_EVEN = 2; public static final int PARITY_MARK = 3; public static final int PARITY_SPACE = 4; private SerialPort sp; private InputStream in; private OutputStream out; private boolean bcc; // Flag indicating whether or not Block Check Character is appended to messages. private MagCardListener notifiable; public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, "MagtekMt85", 32000); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); } public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int timeout, int bitsPerSecond, int parity, boolean bcc) throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException, IOException { CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(serialPort); sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); if (timeout <= MT85_ENCODE_TIMEOUT) { throw new UnsupportedCommOperationException("Timeout must be greater than MT-85 encode timeout (30s)."); } sp.enableReceiveTimeout(timeout); sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); switch (parity) { case PARITY_NONE: parity = SerialPort.PARITY_NONE; break; case PARITY_ODD: parity = SerialPort.PARITY_ODD; break; case PARITY_EVEN: parity = SerialPort.PARITY_EVEN; break; case PARITY_MARK: parity = SerialPort.PARITY_MARK; break; case PARITY_SPACE: parity = SerialPort.PARITY_SPACE; break; default: throw new UnsupportedCommOperationException("Invalid parity parameter."); } sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, parity); in = sp.getInputStream(); out = sp.getOutputStream(); this.bcc = bcc; } .................. } From doug at dupreeinc.com Tue Jan 16 15:07:09 2007 From: doug at dupreeinc.com (Doug Thistlethwaite) Date: Tue, 16 Jan 2007 14:07:09 -0800 Subject: [Rxtx] Identifing hardware in winXP Message-ID: <45AD4C8D.8080106@dupreeinc.com> Hello, I have a hardware device that uses an FTDI USB module with their virtual com port (VCP) driver. My java application uses RXTX to communicate with this device and everything seems to be working pretty well. I need to find the virtual com port that this device uses from within my java application. Is there any way to use RXTX to interrogate winXP to get driver information on com ports so I can pick the correct one automatically? Does anybody have any alternate ideas on how to identify the com port hardware from within java? Thanks, Doug From tjarvi at qbang.org Tue Jan 16 16:53:16 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:53:16 -0700 (MST) Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: <200701161647.43742.hentyw@ipay.co.za> References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: On Tue, 16 Jan 2007, Henty Waker wrote: > Hi there > > We have a java application (jdk1.5) that talks to a parallell printer and > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow control, > no-parity) > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same application > jar on both platforms. > > Under rxtx: > 1)It's working fine on Linux. > 2)Only the parallell port is working under Windows (XP). Serial does not work. > > Under javacomm: > (after changing import gnu.io to javax.comm) parallell and serial work fine > under windows. > > > More details of failure of rxtx on Windows XP: > 1) It failed on a fresh XP system before sun's javacomm was installed. > 2) Tried with both std serial port and usb-serial converter. Both failed. > 3) Startup reports no error messages when correct port is used. > 4) Startup reports error message if port is used by another application. > 5) Startup reports error message if invalid port is used. > > > I imagine this is not enough info to offer me much advice, but can someone > tell me how to get more debug info out of rxtx? > > Thanks > Henty > > Code snippet: > > magCardDevice = new EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > MagCardDevice { > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is long > enough to open serial port. > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 hard-coded > timeout for encoding magnetic stripe. > > private static final byte STX = 0x02; > private static final byte ETX = 0x03; > private static final byte NAK = 0x15; > private static final byte ESC = 0x1B; > > // Constants for parity. > public static final int PARITY_NONE = 0; > public static final int PARITY_ODD = 1; > public static final int PARITY_EVEN = 2; > public static final int PARITY_MARK = 3; > public static final int PARITY_SPACE = 4; > > private SerialPort sp; > private InputStream in; > private OutputStream out; > private boolean bcc; // Flag indicating whether or not Block Check > Character is appended to messages. > > private MagCardListener notifiable; > > public EmbeddedMagtekMt85(String serialPort) throws PortInUseException, > NoSuchPortException, UnsupportedCommOperationException, IOException { > this(serialPort, "MagtekMt85", 32000); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout) throws PortInUseException, NoSuchPortException, > UnsupportedCommOperationException, IOException { > this(serialPort, ownerAppName, timeout, 4800, PARITY_NONE, false); > } > > public EmbeddedMagtekMt85(String serialPort, String ownerAppName, int > timeout, int bitsPerSecond, int parity, boolean bcc) throws > PortInUseException, NoSuchPortException, UnsupportedCommOperationException, > IOException { > CommPortIdentifier cpi = > CommPortIdentifier.getPortIdentifier(serialPort); > sp = (SerialPort)cpi.open(ownerAppName, PORT_OPEN_TIMEOUT); > if (timeout <= MT85_ENCODE_TIMEOUT) { > throw new UnsupportedCommOperationException("Timeout must be > greater than MT-85 encode timeout (30s)."); > } > sp.enableReceiveTimeout(timeout); > sp.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); > > switch (parity) { > case PARITY_NONE: > parity = SerialPort.PARITY_NONE; > break; > case PARITY_ODD: > parity = SerialPort.PARITY_ODD; > break; > case PARITY_EVEN: > parity = SerialPort.PARITY_EVEN; > break; > case PARITY_MARK: > parity = SerialPort.PARITY_MARK; > break; > case PARITY_SPACE: > parity = SerialPort.PARITY_SPACE; > break; > default: > throw new UnsupportedCommOperationException("Invalid parity > parameter."); > } > > sp.setSerialPortParams(bitsPerSecond, SerialPort.DATABITS_7, > SerialPort.STOPBITS_1, parity); > > in = sp.getInputStream(); > out = sp.getOutputStream(); > > this.bcc = bcc; > } > > .................. > } Hi Henty What do you mean by fail? For more debugging you can recompile the jar after flipping debug flags in RXTXCommDriver.java and RXTXPort.java. Further debugging is available in the native code but not recommended. You would have to recompile the dll which isn't a great experience to say the least. The settings look sane. RxTx and Sun CommAPI do have slightly different behavior and defaults as the defaults are not documented and both efforts have different organic origins. Usually, RxTx just drops in without issue though. The w32 serial port support is not bug free but is used in production software without significant problems. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:55:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:55:51 -0700 (MST) Subject: [Rxtx] Identifing hardware in winXP In-Reply-To: <45AD4C8D.8080106@dupreeinc.com> References: <45AD4C8D.8080106@dupreeinc.com> Message-ID: On Tue, 16 Jan 2007, Doug Thistlethwaite wrote: > Hello, > > I have a hardware device that uses an FTDI USB module with their virtual > com port (VCP) driver. My java application uses RXTX to communicate > with this device and everything seems to be working pretty well. I need > to find the virtual com port that this device uses from within my java > application. Is there any way to use RXTX to interrogate winXP to get > driver information on com ports so I can pick the correct one > automatically? Does anybody have any alternate ideas on how to identify > the com port hardware from within java? > Hi Doug RxTx enumerates the ports that are on the system by opening and trying a timed out read. There is no support for hotplug detection. There are examples of enumerating the ports in the contrib directory with the source code. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Jan 16 16:59:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jan 2007 16:59:50 -0700 (MST) Subject: [Rxtx] PROBLEM IN RECEIVING all data transmitted In-Reply-To: <1102b5d4518.m.zach@tin.it> References: <1102b5d4518.m.zach@tin.it> Message-ID: On Tue, 16 Jan 2007, m.zach at tin.it wrote: > Hello... a month ago...I came to know about this wonderful library. > I've been using it in a Laptop Windows XP with a serial port in a > PCMCI. > I have dimensioned a buffer [113] bytes. I noticed that i > receive well all data in a baud rate of 9600. > When I increased teh > dimension of the buffer to 221 and 413 I don't receive anymore all data > as transmitted from the other side.Some time data is lost. > Can you > please tell me what do I do wong. > Can you give me a hint. > Thanks to > all. Hi 'M' :) Perhaps you want to try modifying the timeouts and thresholds? This will tell read to wait until the right amount of data has been recieved. It is interesting that changing the sie of the array results in less data being read. RxTx does not implement buffers if you are trying to change those. You can use buffered streams for that. -- Trent Jarvi tjarvi at qbang.org From hentyw at ipay.co.za Wed Jan 17 05:06:28 2007 From: hentyw at ipay.co.za (Henty Waker) Date: Wed, 17 Jan 2007 14:06:28 +0200 Subject: [Rxtx] rxtx-2.1-7-bins-r2 OK on Linux, fails on Windows. javaComm OK on Windows. In-Reply-To: References: <200701161647.43742.hentyw@ipay.co.za> Message-ID: <200701171406.28661.hentyw@ipay.co.za> Thanks for the response Trent. The rest of my reply is at the end if this email. Henty On Wednesday 17 January 2007 01:53, Trent Jarvi wrote: > On Tue, 16 Jan 2007, Henty Waker wrote: > > Hi there > > > > We have a java application (jdk1.5) that talks to a parallell printer and > > serial magnetic card reader/writer (Magtek MT-85: 4800bps, no flow > > control, no-parity) > > > > We've want to use rxtx 2.1 (gnu.io.rxtx) in order to use the same > > application jar on both platforms. > > > > Under rxtx: > > 1)It's working fine on Linux. > > 2)Only the parallell port is working under Windows (XP). Serial does not > > work. > > > > Under javacomm: > > (after changing import gnu.io to javax.comm) parallell and serial work > > fine under windows. > > > > > > More details of failure of rxtx on Windows XP: > > 1) It failed on a fresh XP system before sun's javacomm was installed. > > 2) Tried with both std serial port and usb-serial converter. Both failed. > > 3) Startup reports no error messages when correct port is used. > > 4) Startup reports error message if port is used by another application. > > 5) Startup reports error message if invalid port is used. > > > > > > I imagine this is not enough info to offer me much advice, but can > > someone tell me how to get more debug info out of rxtx? > > > > Thanks > > Henty > > > > Code snippet: > > > > magCardDevice = new > > EmbeddedMagtekMt85(configuration.magCardDevicePortName); > > > > public class EmbeddedMagtekMt85 implements SerialPortEventListener, > > MagCardDevice { > > private static final int PORT_OPEN_TIMEOUT = 3000; // Assume 3s is > > long enough to open serial port. > > private static final int MT85_ENCODE_TIMEOUT = 30000; // MT-85 > > hard-coded timeout for encoding magnetic stripe. > > > > private static final byte STX = 0x02; > > private static final byte ETX = 0x03; > > private static final byte NAK = 0x15; >